cmake_minimum_required(VERSION 3.15)

project(musesdk)

set(CMAKE_CXX_STANDARD 17)


IF (WIN32)
	MESSAGE(STATUS "Now is windows")
	set(OS_NAME "win")
ELSEIF (APPLE)
	MESSAGE(STATUS "Now is Apple systens.")
	set(OS_NAME "macx")
ELSEIF (UNIX)
	MESSAGE(STATUS "Now is UNIX-like OS's. Including aPPLE os x  and CygWin")
	set(OS_NAME "unix")
	add_definitions(-D OS_LINUX)
	set(LIBS stdc++fs)
ENDIF ()



file(GLOB_RECURSE DIR_SRCS src/*.cpp)
message(${DIR_SRCS})

include_directories(
	./include
)
set(CMAKE_DEBUG_POSTFIX d)
add_definitions(-D LIB_EXPORTS)
add_library(musesdk SHARED ${DIR_SRCS})
TARGET_LINK_LIBRARIES(musesdk ${LIBS})


add_executable(testmuse ./test/test.cpp)
target_link_libraries(testmuse musesdk)
install(TARGETS musesdk 
        RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/../../src/3rd/musesdk/bin
        LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/../../src/3rd/musesdk/lib/${OS_NAME}
        ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/../../src/3rd/musesdk/lib/${OS_NAME})

install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION ${PROJECT_SOURCE_DIR}/../../src/3rd/musesdk)